import request from '@/utils/request'

// 分页查询退款记录列表
export function getRefundList(params) {
  return request({
    url: '/refundRecord/list',
    method: 'get',
    params
  })
}

// 根据ID查询退款记录详情
export function getRefundById(id) {
  return request({
    url: `/refundRecord/${id}`,
    method: 'get'
  })
}

// 创建退款记录
export function createRefund(data) {
  return request({
    url: '/refundRecord',
    method: 'post',
    data
  })
}

// 更新退款记录信息
export function updateRefund(id, data) {
  return request({
    url: `/refundRecord/${id}`,
    method: 'put',
    data
  })
}

// 根据ID删除退款记录
export function deleteRefund(id) {
  return request({
    url: `/refundRecord/${id}`,
    method: 'delete'
  })
}

// 批量删除退款记录
export function batchDeleteRefunds(ids) {
  return request({
    url: '/refundRecord/batch',
    method: 'delete',
    data: ids
  })
}

// 更新退款记录处理状态
export function updateRefundStatus(id, processStatus) {
  return request({
    url: `/refundRecord/${id}/status`,
    method: 'patch',
    params: { processStatus }
  })
}

